package zpf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zpf.entity.User;
import zpf.feign.UserFeignCustomClient;
import zpf.feign.UserFeignCustomSecondClient;

/**
 * @ClassName: MovieFeignCustomController
 * @Description: 自定义 Feign 控制器
 * @Autor: ZPF
 * @Date: 2021/1/13 13:22
 **/
@RestController
public class MovieFeignCustomController {

    @Autowired
    private UserFeignCustomClient userFeignCustomClient;

    @Autowired
    private UserFeignCustomSecondClient userFeignCustomSecondClient;

    @GetMapping("/movie/{id}")
    public User findById(@PathVariable Long id) {
        return userFeignCustomClient.findById(id);
    }

    @GetMapping("/{serviceName}")
    public String findEurekaInfo(@PathVariable String serviceName) {
        return userFeignCustomSecondClient.findEurekaInfo(serviceName);
    }

}
